package com.sai.sql;

public class SqlProfesor {
    public static final String SELECT;
    public static final String SELECT_ALL;
    public static final String INSERT_PROFESOR;
    public static final String INSERT_TUTOR;
    public static final String UPDATE_AFTER_UPDATE;
    public static final String DELETE;
    
    static {
        StringBuilder qryBuilder = new StringBuilder();

        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT * FROM profesor WHERE nombre = ?");
        qryBuilder.append("SELECT * FROM profesor WHERE idProfesor = ?");
        SELECT = qryBuilder.toString();

        qryBuilder = new StringBuilder();
        qryBuilder.append("SELECT * FROM profesor");
        SELECT_ALL = qryBuilder.toString();

        qryBuilder = new StringBuilder();
        qryBuilder.append("INSERT INTO profesor(Nombre,ApellidoMaterno,ApellidoPaterno,GrupoAsesorado,Materia,Matricula,TipoUser) values (?,?,?,?,?,?,2)");
        INSERT_PROFESOR = qryBuilder.toString();

        qryBuilder = new StringBuilder();
        qryBuilder.append("INSERT INTO profesor(Nombre,ApellidoMaterno,ApellidoPaterno,GrupoAsesorado,Materia,Matricula,TipoUser) values (?,?,?,?,?,?,3)");
        INSERT_TUTOR = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("UPDATE autores SET estado = 'Activo' WHERE id_autor = ?");
        UPDATE_AFTER_UPDATE = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
        qryBuilder.append("DELETE from profesor WHERE idProfesor = ?");
        DELETE = qryBuilder.toString();
     }
}
